package com.kuyun.dingshi.controller;


import com.kuyun.dingshi.bean.LoggerBean;
import com.kuyun.dingshi.bean.ResponseBean;
import com.kuyun.dingshi.entity.Admin;
import com.kuyun.dingshi.service.impl.AdminServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("/user")
public class AdminOne {
	@Autowired
	private AdminServiceImpl adminService;

	 @RequestMapping(value = "/getadmin",method = RequestMethod.GET)
	 @ResponseBody
	public ResponseBean getAdmin(Long id)throws Exception{
 	if(id == null){
 		return new ResponseBean().setErrorResponse("null");
		}
		 LoggerBean.SYSTEM.error("参数为空了");
//		if(id==0){
//			return new ResponseBean().setErrorResponse("参数为空");
//		}
		 Admin admin=adminService.getAdmin(1L);
		 ResponseBean responseBean = new ResponseBean().setSuccessResponse();
		 responseBean.getData().put("admin",admin);
		 return responseBean;
	 }

}
